package com.jd.scaffold.web.controller.biz;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.jd.scaffold.web.controller.base.BaseController;

/**
 * 
 * 描述:主页面请求
 * <p>创建人：jrzhangwei 创建日期：2014年10月31日 </p>
 * @version V1.0
 */
@Controller
public class IndexController  extends BaseController {
	
	private Logger logger = LoggerFactory.getLogger(IndexController.class);

    @RequestMapping("/index.do")
    public ModelAndView index(){
    	ModelAndView mav = new ModelAndView("/main");
    	mav.addObject("JD_OPERATE_WEB_LOGIN_USER",getNick());
    	return mav;
    }
    
    @RequestMapping("/logout.do")
    public String logout(HttpServletRequest request,HttpServletResponse response){
    	logger.info("用户【"+getNick()+"】登出");
    	logOut(request,response);
    	return "redirect:/index.do";
    }
}
